function getRoutes(data) {
    let newRoutes = data.map(v => {
        let routes = {
            path: v.path,
            name: v.name,
            meta: {
                name: v.title
            },
            component: () =>
                import (`@/views/test/${v.name}.vue`)
        }
        if (v.children) {
            routes.children = getRoutes(v.children)
        }
        return routes
    })
    return newRoutes
}

export default getRoutes